/**
 *@author
 */
package modellayer;

/**
 * The Class Salesman.
 *@author Benjamin Ørskov
 *@author Lasse Lambertsen
 *@author Ole Kirk
 *@author Søren Søgaard
 */
public class Salesman extends Person implements Comparable<Salesman> {

	/** The id. */
	private int id;

	/** The revenue. */
	private Double revenue;

	/** The paycheck. */
	private Double paycheck;

	/** The bonus. */
	private Double bonus;

	/**
	 * Instantiates a new salesman.
	 *
	 * @param name
	 *            the name
	 * @param address
	 *            the address
	 * @param city
	 *            the city
	 * @param email
	 *            the email
	 * @param phone
	 *            the phone
	 * @param id
	 *            the id
	 * @param paycheck
	 *            the paycheck
	 */
	public Salesman(String name, String address, String city, String email,
			String phone, int id, Double paycheck) {
		super(name, address, city, email, phone);
		this.id = id;
		this.paycheck = paycheck;
		revenue = 0.0;
	}

	/**
	 * Gets the id.
	 *
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * Sets the id.
	 *
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * Gets the revenue.
	 *
	 * @return the revenue
	 */
	public Double getRevenue() {
		return revenue;
	}

	/**
	 * Sets the revenue.
	 *
	 * @param revenue
	 *            the revenue to set
	 */
	public void setRevenue(Double revenue) {
		this.revenue = revenue;
	}

	/**
	 * Gets the paycheck.
	 *
	 * @return the paycheck
	 */
	public Double getPaycheck() {
		return paycheck;
	}

	/**
	 * Sets the paycheck.
	 *
	 * @param paycheck
	 *            the paycheck to set
	 */
	public void setPaycheck(Double paycheck) {
		this.paycheck = paycheck;
	}

	/**
	 * Gets the bonus.
	 *
	 * @return the bonus
	 */
	public Double getBonus() {
		return bonus;
	}

	/**
	 * Sets the bonus.
	 *
	 * @param bonus
	 *            the bonus to set
	 */
	public void setBonus(Double bonus) {
		this.bonus = bonus;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see modellayer.Person#toString()
	 */
	@Override
	public String toString() {
		return super.toString() + "\nID: " + id + "\nOmsætning: " + revenue
				+ "\nLøn: " + paycheck + "\nBonus: " + bonus;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(Salesman s) {
		return s.getRevenue().compareTo(this.getRevenue());
	}

}